#include "Thread.hpp"
#include<unistd.h>

using namespace ThreadModule;

//也可以传对象
class ThreadData
{
public:
    pthread_t tid;
    std::string name;
};

void Count (ThreadData td)
{
    while(true)
    {
        std::cout<<"我是一个新线程"<<std::endl;
        sleep(1);
    }
}

int main()
{
    ThreadData td;
    Thread<ThreadData> t(Count,td);
    
    t.Start();

    sleep(5);
    t.Stop();

    t.Join();

    sleep(5);

    return 0;
}